home *** CD-ROM | disk | FTP | other *** search
- unit BmpUserU;
-
- interface
-
- uses
- WinProcs, WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, StdCtrls;
-
- type
- TForm1 = class(TForm)
- Image1: TImage;
- Button1: TButton;
- Button2: TButton;
- procedure FormCreate(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- DLLHandle: THandle;
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses
- ResConst;
-
- {$R *.DFM}
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- DLLHandle := LoadLibrary('ResLib.Dll');
- if DLLHandle < HInstance_Error then
- {$ifdef Win32}
- RaiseLastWin32Error;
- {$else}
- raise Exception.Create('Could not load resource DLL')
- {$endif}
- end;
-
- procedure TForm1.FormDestroy(Sender: TObject);
- begin
- FreeLibrary(DLLHandle)
- end;
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- Image1.Picture.Bitmap.Handle :=
- LoadBitmap(DLLHandle, MakeIntResource(bmpAthena))
- end;
-
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- Image1.Picture.Bitmap.Handle :=
- LoadBitmap(DLLHandle, PChar(bmpChemical))
- end;
-
- end.
-